﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;

namespace Gnosis.SQLite.Tables
{
    public class TableForeignKey
        : Constraint
    {
        public TableForeignKey(ConstraintName name, ColumnList columns, References foreignTable, ColumnList foreignColumns)
            : base(name, "FOREIGN KEY")
        {
        }

        public TableForeignKey(ConstraintName name, ColumnList columns, References foreignTable, ColumnList foreignColumns, OnUpdate onUpdate, OnDelete onDelete)
            : base(name, "FOREIGN KEY", new List<IExpression> { columns, foreignTable, foreignColumns, onUpdate, onDelete })
        {
        }

        public TableForeignKey(ConstraintName name, CommaList columns, References foreignTable, CommaList foreignColumns, OnUpdate onUpdate, OnDelete onDelete, DeferralAction deferral)
            : base(name, "FOREIGN KEY", new List<IExpression> { columns, foreignTable, foreignColumns, onUpdate, onDelete, deferral })
        {
        }
    }
}
